﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" ValidateRequest = "false" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Manager" Title="XML Project - Yamaha Advertising - Manage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="_content" Runat="Server">    
        <div class="ui-widget-shadow ui-corner-all" style="width: 423px; height: 62px; position: relative; left: 490px; top: 5px; margin-bottom:10px;">
			<div style="position: absolute; width: 400px; height: 40px;left: 8px; top: 7px; padding: 10px;" class="ui-widget ui-widget-content ui-corner-all">
				<div class="ui-dialog-content ui-widget-content" style="background: none; border: 0;">
					<asp:Label ID="lblChao" runat="server" Text=""></asp:Label>
            <br />
            <asp:LinkButton ID="lblDangXuat"
                runat="server" CausesValidation="False" onclick="lblDangXuat_Click"><b>Log Out</b></asp:LinkButton>
				</div>
			</div>
		</div>
           <center>               
                    <div id="tabs">
                        <ul>
                            <li><a href="#tabs-1">Thông Tin Chung</a></li>
                            <li><a href="#tabs-2">Thông Tin Kỹ Thuật</a></li>
                        </ul>
                        
                        <div id="tabs-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
                            <table>
                            <tr>
                                <td>
                                    Loại sản phẩm:</td>
                                <td>
                                    <asp:DropDownList ID="ddlLoaiSP" runat="server" Height="23px" Width="195px" 
                                        DataSourceID="XmlDataSource1" DataTextField="ten" DataValueField="ten" 
                                        onselectedindexchanged="ddlLoaiSP_SelectedIndexChanged"  
                                        AutoPostBack="True">
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtAn" runat="server" Visible="False" Width="100px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Tên sản phẩm:</td>
                                <td>
                                    <asp:TextBox ID="txtTenSP" runat="server" Width="300px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ErrorMessage="Bạn Chưa Thêm Tên SP" ControlToValidate="txtTenSP"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Đặc Tính:</td>
                                <td>
                                    <asp:TextBox ID="txtDacTinh" runat="server" Width="300px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ErrorMessage="Bạn Chưa Thêm Đặc Tính" ControlToValidate="txtDacTinh"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                    <td>
                                        Giá Tiền:</td>
                                    <td>
                                        <asp:TextBox ID="txtGiaTien" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                        ErrorMessage="Bạn Chưa Thêm Giá Tiền" ControlToValidate="txtGiaTien"></asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                            ErrorMessage="Bạn Phải Nhập Tiền Là Số Lớn Hơn 0" 
                                            ControlToValidate="txtGiaTien" MaximumValue="1000000000" MinimumValue="1" 
                                            Type="Integer"></asp:RangeValidator>
                                    
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Hình:</td>
                                    <td>
                                        <asp:FileUpload ID="fuHinh" runat="server" Width="304px" />
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                        ErrorMessage="Bạn Chưa Thêm Hình" ControlToValidate="fuHinh"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                        </table>
                            <br />
                            <asp:GridView ID="gvHienThiTTChung" runat="server" AutoGenerateColumns="False" 
                                BackColor="White" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" 
                                CaptionAlign="Top" CellPadding="10" CssClass="gridviewad" DataKeyNames="MaSP" 
                                EmptyDataText="Không có dữ liệu" EnableModelValidation="True" 
                                EnableTheming="False" ForeColor="Black" HorizontalAlign="Center" 
                                onrowdeleting="gvHienThiTTChung_RowDeleting" 
                                onselectedindexchanging="gvHienThiTTChung_SelectedIndexChanging" Width="881px">
                                <Columns>
                                    <asp:CommandField HeaderText="Chọn" SelectText="[  ]" ShowSelectButton="True">
                                    <HeaderStyle CssClass="gridviewad" Height="30px" />
                                    <ItemStyle CssClass="gridview" />
                                    </asp:CommandField>
                                    <asp:CommandField DeleteText="[X]" HeaderText="Xóa" ShowDeleteButton="True">
                                    <HeaderStyle CssClass="gridviewad" />
                                    <ItemStyle CssClass="gridview" />
                                    </asp:CommandField>
                                    <asp:BoundField DataField="MaSP" HeaderText="Mã sản phẩm">
                                    <ControlStyle Height="50px" />
                                    <HeaderStyle Height="30px" />
                                    <ItemStyle CssClass="gridviewad" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="TenSP" HeaderText="Tên sản phẩm">
                                    <HeaderStyle CssClass="gridviewad" />
                                    <ItemStyle CssClass="gridviewad" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="DacTinh" HeaderText="Đặc tính">
                                    <ControlStyle Width="200px" />
                                    <HeaderStyle CssClass="gridview" />
                                    <ItemStyle CssClass="gridview" Width="220px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="GiaTien" HeaderText="Giá tiền">
                                    <ItemStyle CssClass="gridviewad" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="Hình">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("Hinh") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Image Width="120px" ID="Image1" runat="server" ImageUrl='<%# Eval("Hinh") %>' CssClass="gridviewad" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                            </asp:GridView>
                        </div>
                        <div id="tabs-2" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
                            <table>
                                <tr>
                                    <td>
                                        Loại động cơ: </td>
                                    <td>
                                        <asp:TextBox ID="txtLoaiDongCo" runat="server" 
                                        Width="300px" ></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Loại Động Cơ" ControlToValidate="txtLoaiDongCo"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Dung tích: </td>
                                    <td>
                                        <asp:TextBox ID="txtDungTich" runat="server" Width="300" 
                                        ></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Dung Tích" 
                                            ControlToValidate="txtDungTich"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Hệ thống đánh lửa: </td>
                                    <td>
                                        <asp:TextBox ID="txtHTDanhLua" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Hệ Thống Đánh Lửa" ControlToValidate="txtHTDanhLua"></asp:RequiredFieldValidator>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Loại khung xe: </td>
                                    <td>
                                        <asp:TextBox ID="txtLoaiKhung" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Loại Khung" ControlToValidate="txtLoaiKhung"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Kích thước khung: </td>
                                    <td>
                                        <asp:TextBox ID="txtKTKhung" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Kích Thước Khung" ControlToValidate="txtKTKhung"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Kích thước xe chuẩn: </td>
                                    <td>
                                        <asp:TextBox ID="txtKTDR" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Kích Thước Dài Rộng" ControlToValidate="txtKTDR"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Độ cao yên xe: </td>
                                    <td>
                                        <asp:TextBox ID="txtDoCao" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Độ Cao Yên Xe" ControlToValidate="txtDoCao"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Thời gian bảo hành: </td>
                                    <td>
                                        <asp:TextBox ID="txtThoiGian" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" 
                                            ErrorMessage="Bạn Chưa Thêm Thời Gian Bảo Hành" ControlToValidate="txtThoiGian"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                </table>
                            <br />
                            <asp:GridView ID="gvHienThiKT" runat="server" AutoGenerateColumns="False" 
                                BackColor="White" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" 
                                CaptionAlign="Top" CellPadding="10" CssClass="gridviewad" DataKeyNames="MaSP" 
                                EmptyDataText="Không có dữ liệu" EnableModelValidation="True" 
                                EnableTheming="False" ForeColor="Black" HorizontalAlign="Center" 
                                onrowdeleting="gvHienThiKT_RowDeleting" 
                                onselectedindexchanging="gvHienThiKT_SelectedIndexChanging" Width="881px">
                                <Columns>
                                    <asp:CommandField HeaderText="Chọn" SelectText="[  ]" ShowSelectButton="True">
                                    <HeaderStyle CssClass="gridviewad" Height="30px" />
                                    <ItemStyle CssClass="gridview" />
                                    </asp:CommandField>
                                    <asp:CommandField DeleteText="[X]" HeaderText="Xóa" ShowDeleteButton="True">
                                    <HeaderStyle CssClass="gridviewad" />
                                    <ItemStyle CssClass="gridview" />
                                    </asp:CommandField>
                                    <asp:BoundField DataField="MaSP" HeaderText="Mã sản phẩm">
                                    <ControlStyle Height="50px" />
                                    <HeaderStyle Height="30px" />
                                    <ItemStyle CssClass="gridviewad" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="LoaiDongCo" HeaderText="Loại Động Cơ" />
                                    <asp:BoundField DataField="DungTich" HeaderText="Dung Tích" />
                                    <asp:BoundField DataField="HeThongDanhLua" HeaderText="Hệ Thống Đánh Lửa" />
                                    <asp:BoundField DataField="LoaiKhung" HeaderText="Loại Khung Xe" />
                                    <asp:BoundField DataField="KichThuoc" HeaderText="Kích Thước Khung" />
                                    <asp:BoundField DataField="KichThuocDaiRong" HeaderText="Kích Thước Xe" />
                                    <asp:BoundField DataField="DoCao" HeaderText="Độ Cao Yên Xe" />
                                    <asp:BoundField DataField="ThoiGian" HeaderText="Thời Gian Bảo Hành" />
                                </Columns>
                                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                            </asp:GridView>
                        </div>
                    </div>
                    <br />
                            <asp:Button ID="btnThem" Text="Thêm" runat="server" onclick="btnThem_Click" Width="100px" Height="25px"/>
                    &nbsp;
                            <asp:Button ID="btnSua" runat="server" Text="Sửa"                            
                            onclick="btnSua_Click" Width="100px" Height="25px" Enabled="False" />
                    &nbsp;
                            <asp:Button ID="btnClear" runat="server" Text="Làm Lại"  
                            onclick="btnClear_Click" CausesValidation="False" Width="100px" Height="25px"/>
            <br />
                    <asp:XmlDataSource ID="XmlDataSource1" runat="server" 
            DataFile="~/App_Data/yamaha.xml"></asp:XmlDataSource>
                </center>
                
</asp:Content>

